package _2025_3_30._2025_3_28;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class demo1 {
    public static void main(String[] args) {
        //用于处理大量短时间线程
        ExecutorService CachedThreadPool = Executors.newCachedThreadPool();
        //可指定线程数量
        ExecutorService FixedThreadPool = Executors.newFixedThreadPool(3);
        //无界队列只有一个线程容量
        ExecutorService SingleThreadExecutor = Executors.newSingleThreadExecutor();
        //单线程执行定时执行
        ExecutorService SingThreadScheduleExecutor = Executors.newSingleThreadScheduledExecutor();
        //定期执行并给定线程数量
        ExecutorService SchedulePool = Executors.newScheduledThreadPool(100);
        //指定大小（不传入参数，根据CPU核心数）的线程池，不保证处理顺序
        ExecutorService WorkstealingPool = Executors.newWorkStealingPool();
    }
}

